package com.ridbor001.demo.service;

import com.ridbor001.demo.bean.RDBStudent;
import com.ridbor001.demo.dao.RDBStudentDAO;

import java.sql.SQLException;
import java.util.List;
import java.util.Optional;

public class RDBStudentService {
    RDBStudentDAO dao = new RDBStudentDAO();
    public boolean studentExists(String studentId) throws SQLException {
        return dao.studentExists(studentId);
    }

    public List<RDBStudent> getAllStudents() throws SQLException {
        return dao.getAllStudents();
    }

    public Optional<RDBStudent> findStudentByIdAndPassword(String id, String password) throws SQLException {
        return dao.findStudentByIdAndPassword(id, password);
    }

    public void addStudent(RDBStudent user) throws SQLException {
        dao.addStudent(user);
    }
}
